package agent.fromKanYun.dynamic;

import java.lang.reflect.Proxy;

public class Test {
    public static void main(String[] args) {
        IUserDao userDao = new UserDaoImpl();
        LogEmbed log = new LogEmbed();
        log.setTarget(userDao);

        IUserDao userDaoProxy = (IUserDao) Proxy.newProxyInstance(userDao.getClass().getClassLoader(), userDao.getClass().getInterfaces(), log);

        userDaoProxy.add(new User("张三", "123"));
    }
}
